package com.zahb.qadx.ui.adapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by huwei.
 * Data 2020-10-12.
 * Time 10:03.
 */
public class CourseAdapter extends FragmentPagerAdapter {
    List<Fragment>fragments;
    List<String>titles;

    public CourseAdapter(FragmentManager fm,List<Fragment>list,List<String>titles) {
        super(fm);
        this.fragments=list;
        this.titles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }
    @Override
    public int getCount() {
        return fragments.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
}
